<?php
class mdl_log_member extends ujn_model {
	protected function __construct() {
		parent::__construct();
		$this->db_name		= GAME;
		$this->tbl_name		= "`{$this->db_name}`.`" . GAME . "_logmember`";
		$this->_db			= $this->mysql();
	}	
	
	public function getDataByMid($mid, $tbl) {
		$data = array();
		if(($mid = tls_func::uint($mid)) && !empty($tbl)) {
			$this->tbl_name = "`{$this->db_name}`.`{$tbl}`";
			$sql = "SELECT a.* FROM {$this->tbl_name} a WHERE a.mid='$mid' ORDER BY ABS(a.id) desc;";
			$data = $this->_db->getAll($sql);
		}
		return $data;		
	}
	
	function getDataByLtid($ltid, $tbl = '') {
		$d = array();
		if(!empty($tbl)) {
			$sql = "SELECT * FROM `{$this->db_name}`.`{$tbl}` a WHERE ltid='{$ltid}';";
			$d = $this->_db->getAll($sql);
		}
		return $d;
	}	
	
	/**
	 * 单例模型
	 * @return mdl_log_member
	 */
	static function getInstance() {
		return parent::getInstance(__CLASS__);
	}	
}